<template>
	<view>
		<!-- 空为了解决高度塌陷 -->
		<view class="empty_box"></view>
		<view class="my_task">
			<view class="my_task_header">
				<view :class="[status === '0' ? 'uncomplete' : 'completed']">{{status === '0' ? '未完成' : '已完成'}}</view>
				<view class=""></view>
			</view>
			<view class="my_task_body">
				<view class="taskName">{{taskName}}</view>
				<view class="">{{endTime}}</view>
				<view class="">{{incentiveAmount}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	// let uncomplete = <span>未完成</span>
	export default {
		data() {
			return {};
		},
		props: {
			status: {
				type: Number
			},
			endTime: {
				type: String
			},
			taskName:{
				type: String
			},
			incentiveAmount:{
				type: Number
			}
		},
		computed: {
			handleTime() {
				// 分割取T前面
				let time = endTime?.split('T')
				// console.log(time)
				return time[0]
			}
		}
	}
</script>

<style lang="scss">
	.task_container {
		/* 确保没有高度的时候也会100% */
		min-height: 100vh;
		background-color: #F1F1F1;
	}

	.empty_box {
		height: 1rpx;
	}

	.my_task {
		width: 90%;
		border-radius: 20rpx;
		height: 200rpx;
		margin: 0 auto;
		overflow: hidden;
		margin-top: 40rpx;

		&_header {
			margin-bottom: 10rpx;
			background-color: #fff;
			height: 30%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 30rpx;

			.uncomplete {
				color: red;
				font-size: 28rpx;
			}

			.completed {
				color: green;
				font-size: 28rpx;
			}
		}

		&_body {
			background-color: #fff;
			height: 70%;
			padding: 0 30rpx;

			.taskName{
				font-size: 28rpx;
			}
		}
	}
</style>
